<!DOCTYPE html>
<%@page import="org.apache.commons.lang3.StringUtils"%>
<%@page import="com.kerrykidz.sales.dao.model.PosOrderEntity"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<jsp:include page="/pad/common/commonCss.jsp"></jsp:include>
<script src="${basePath}pad/commonJs/jquery.min.js"></script>
<script src="${basePath}pad/commonJs/jquery.easyui.min.js"></script>
<script src="${basePath}pad/commonJs/jt_normal.js"></script>
<script src="${basePath}pad/commonJs/jt_select.js"></script>
<title></title>
</head>
<body class="bg">
<div class="top"><a class="icon iconfont fl ml10" href="${basePath}goods/padSales.shtml">&#xe612;</a>订单信息</div>
<div class="i_index">
        <!-- 内容 -->
		<div class="p20">
            <div class="goods_order_top fixed mt10 f14">
            	<ul class="ml10">
                	<li><label>订单号：</label>${order.pkOrderId }</li>
						<li><label>客户姓名：</label>${order.cusName }</li>
						<li><label>当前操作人：</label>${order.operator }</li>
						<li><shiro:principal></shiro:principal></li>
                </ul>
            </div>
            <table class="table mt10">
            	<tr>
                    <th>序号</th>
                    <th>商品编号</th>
                    <th>商品名称</th>
                    <th width="150">数量</th>
                    <th>单价</th>
                    <th>小计</th>
                    <th>折扣率</th>
                    <th>备注</th>
                    <th>折后金额</th>
                </tr>
               <c:forEach var="p" items="${products }" varStatus="vs">
						<tr>
							<td>${vs.index+1 }</td>
							<td>${p.fkPrdId }</td>
							<td><c:choose>
									<c:when test="${p.type eq '1' }">
									${p.productName }
								</c:when>
									<c:otherwise>
									充值
								</c:otherwise>
								</c:choose></td>
							<c:choose>
								<c:when test="${p.type eq '1' }">
									<td>${p.count }</td>
									<td>${p.price }</td>
									<td>${p.price*p.count }</td>
								</c:when>
								<c:otherwise>
									<td>-</td>
									<td>-</td>
									<td>${p.count }</td>
								</c:otherwise>
							</c:choose>
							<td>${empty p.disValue ? '无' :p.disValue  }</td>
							<td>${p.discComments }</td>
							<td>${p.disPrice }</td>
						</tr>
					</c:forEach>
                	<tr>
						<td colspan="9">
							<ul class="goods_ul fr p10">
								<!-- 非预付 -->
								<c:if test="${!isPrepay }">
									<c:set value="${order.paidAmount==null?0:order.paidAmount  }"
										var="paidAmount"></c:set>
									<li>商品总价：<span class="color_lv mlr5 f18">￥${order.amount }</span></li>
									<c:if test="${paidAmount>0 }">
										<li>已付金额：<span class="color_lv mlr5 f18">￥${paidAmount }</span></li>
									</c:if>
									<c:if test="${wbqje!=null and wbqje>0 }">
										<li>玩伴券金额：<span class="color_lv mlr5 f18">￥${wbqje }</span></li>
									</c:if>
									<c:if test="${giftPrice!=null and giftPrice>0 }">
										<li>礼券金额：<span class="color_lv mlr5 f18">${giftPrice }</span></li>
									</c:if>
									<c:if test="${hyxfzk!=null and hyxfzk>0 }">
										<li>会员续费优惠金额：<span class="color_lv mlr5 f18">${hyxfzk }</span></li>
									</c:if>
									<c:if test="${zkje!=null and zkje>0 }">
										<li>折扣金额<span class="color_lv mlr5 f18"><fmt:formatNumber
													value="${zkje}" pattern="￥.0#"></fmt:formatNumber></span></li>
									</c:if>
								</c:if>
							</ul>
						</td>
					</tr>
            </table>
            <div class="clear"></div>
            <table class="table mt10">
            		<tr>
						<th>操作人</th>
						<th>操作时间</th>
						<th>收银金额</th>
						<th>收银方式</th>
						<th>对应订单号</th>
						<th>操作描述</th>
					</tr>
              	<c:forEach items="${records }" var="p">
						<tr>
							<td>${p.operator }</td>
							<td><fmt:formatDate value="${p.opeTime }" /></td>
							<td class=" color_org">￥${p.price }</td>
							<td><c:choose>
									<c:when test="${p.payMethod eq '1' }">
										现金
									</c:when>
									<c:when test="${p.payMethod eq '2' }">
										储值消费
									</c:when>
									<c:otherwise>
										银行卡
									</c:otherwise>
								</c:choose></td>
							<td class="lv">${p.id }</td>
							<td>${p.opeDesc }</td>
						</tr>
					</c:forEach>
            </table>
        </div>
        <!-- 内容 -->
</div>
</body>
</html>